#ifndef __RULES_PROCESSING_USER_MODE_H__
#define __RULES_PROCESSING_USER_MODE_H__

#include <iostream>
#include <windows.h>
#include <string>
#include <vector>

// TODO: must be in Utils library
class KeyGuard
{
    public:
        KeyGuard()
		    : hKey_(0)
	    {
        }

	    KeyGuard(HKEY hKey)
		    : hKey_(hKey)
	    {
	    }

        void reset(const HKEY hKey = 0)
        {
            if (0 != hKey_)
            {
                RegCloseKey(hKey_);
            }

            hKey_ = hKey;
        }

        HKEY getKey()
        {
            return hKey_;
        }

        ~KeyGuard()
        {
            RegCloseKey(hKey_);
        }

    private:
        KeyGuard(const KeyGuard&);
        KeyGuard& operator =(const KeyGuard&);

        HKEY hKey_;
};

struct IMultiSZObserver
{
    virtual void OnMultiSZItemFound(const std::wstring& wsMultiSZItem) = 0;

	~IMultiSZObserver(){}
};

//Get string vector of MULTI_SZ registry values and call IMultiSZObserver::OnMultiSZItemFound item-by-item
void EnumMultiSZValue(const std::wstring& wstrKey, const std::wstring& wstrValue, IMultiSZObserver* pObserver);

//Write values from wstring vector to registry MULTI_SZ value
void WriteMultiSZValue(const std::wstring& wstrKey, const std::wstring& wstrValue, const std::vector<std::wstring>& vwsMultiSZItems);

#endif